package com.relax.tcp.server;

import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelHandlerContext;

public class MyServerHandler extends ChannelDuplexHandler {
    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        System.out.println("MyServerHandler channelActive");
//        ctx.channel().eventLoop().scheduleAtFixedRate(()->{
//            System.out.println("MyServerHandler 定时任务开启");
//        },10,3,TimeUnit.SECONDS);
        super.channelActive(ctx);
    }


    @Override
    public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
        System.out.println("MyServerHandler handlerAdded");
        super.handlerAdded(ctx);
    }

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        System.out.println("MyServerHandler channelRead");
        super.channelRead(ctx, msg);
    }
}
